fixed a bug for login