added call back function for on clear