fixing bug with user validation