Fixed a bug in the validation rule