Fix a bug in data sync