Fixed bug with messages socket