Move file deletion to the correct spot.