updated for socket stuff