Destroying connection if not logged in when close is called