delete and swap files