fixed bugs in login