fixed infinite loop when clearing dataset