added input data check