Fix sync bug