Fix a bug with server when a user logged in