setData function

Check the input data