preventing data loose on undo action in pies