fix state sync bug