implemented canvasResize