Fix for server process not ending