Added protection against the server crashing.