replace rename() with copy() + unlink()