fix logging in after registering a new user