adding more validation code