fix few bugs when authenticating with new user