Error with receiving messages from the server