ADDED WATCH DOG CODE