adding cleanup code