patch debug mode