Add the watch dog function