implemented watchdog. fixes #14
implemented watchdog. fixes #14