moved gettcp() state arg to front