add new transaction helper to make it easy to ensure transactions are always ended