Make sure you are logged in before getting a connection.