Fixed a bug in validations