debug mode modified