watchdog function added