fixed minor socket problems