using debug_enabled flag to separate debugged running and normal running.