working on socket connection