Adding functionality to close transactions