debugging watchdog code