fix issue when syncing for the second time.