Improve transaction closure