Removed race condition when switching sync mode