fix a bug of showing error message during login