Correct stop the server on the process stop and processing errors when the server starts