Added exceptions to handle flow of transactions.