more robust undo dir settings