Senate approves funding bill to avoid a shutdown before the election