fix the sync bug