add - more checks, clean of the Textprotocol code