added debug_mode() method