Fix a bug at login