code to check data.