rename file and cleanup