added send data to socket functionality