added some cleanup handling