Fix new user function and add login