fixed some changes to the list cleanup code