fix creating and accepting TCP connections