fixed socket reading