validating input data