How to implement a rollback feature