modified cleanup script