trying to fix bug when clearing