Fixed bug with server closing connection right after sending goodbye message