readd socket functionality