fix crash while server stop