updated logic for logging in, optimized when it download profile pic and when it updates the UserModel