Fix shutDown server on GUI cause crash