fix wrongly linking output tx to input tx.