add a check for client to check whether the server has been shut down