implemented undo/redo for resizing