add undo command for removing layers in legend