Added error handling to Restart() method