Implementing a watchdog