switched from async socket reading to sync