Add the data validity check before handle the data and update the unit test.