Added exception handling to synchronization.