directory depth bug fix