Fix canvas bug