prepare for resizing