fix canvas bug