fixed Validation code