Script modified for transactions