fix the db bug when first sync