fix bug when clearing the box