Added socket functionality