added sync error handling