Fixed encoding issue in received messages