fix the canvas event bug