need to change arguments from socket to stream on message handlers