added debug toggle/exposed debug mode status flag