implemented transaction and close methods