fix some bugs on login