Fixed socket issues