bugfix of login method