Fixed bug when receiving some messages