Fixed canvas resetting problem