start wrapping debug code