Fixing bug with password validation