before saving transaction