encapsulate transaction in using statement