validate for input data