declare txn id outside try except block