Added transaction to rollback when error is occured