added xml excpeption handling, added doublerestart