fixed bug when resizing exceeds given values