fix crash if directory selection is aborted