refactored script to wrap stored procedure calls in a transaction