added watchdd function