fix and improve SendTx example