need to implement undo function