adjustments made to fix soem bugs in resizing