validation code added