Bug fix: when server stop client still receiving messages from buffer