undo working for non-drawing tools