get tcp working correctly