fix a bug in validation