Fixed issue that is caused on undo after resizing a widget