bug fixes for transaction issue