add a function to check the dirty data problem