fixed clear functionality