fixed clear function