table clear function fixed