Fixed IE9 issue when resizing the canvas