fixs bug when service openning privious state