Fixed bug with receiving messages