wrote seek to socket functionality