added socket stuff