cleanup callback code