Fix clear function bug when switching back to normal mode