fix bug with clear func