Corrected directory search bug