ensure auth and select db happen before anything else
Merge pull request #1 from portertech/auth_and_select_db

ensure auth and select db happen before anything else