Adding rollback functionality