work in progress, need to handle duplex connection