Fixed missing tx.finish()