Finish adding logic to handle closed client connection in frontend.