right before cleanup