validating inputs