trying to fix canvas resizing bug