Re-adding some missing code into the login