Renamed readthread to receivethread
working on control thread