fix bugs in login