[MH,RG] add some new functionality for the undo button