fix a bug of restart