solved the cannot shut down server problem when clients are still running