fixing when the window gets smaller