fix bug when stop server