implement file resizing