trying to get socket connection to work better