transaction, exception handling added (#1)

transaction, exception handling added (#1)