Registration form: duplicate validation does not work