Watchdog Timer Added to Main Program

Added watchdog timer to make program more robust.