assignment6: correct rollback handling