fixed waitForResult on server shutdown