watchdog functionality in monitor script