fix emit serverDestroyed logic