Corrected password validation and creation of new user