fix boxes moving out of window