added hooks to better deal with watchdogs