Fixed canvas resizing issue