Fixed canvas size error on resize