fixing duplicate transaction issue