fix bugs for login