add an input data check. #2