fix clear canvas bug