fix clearing bug