bug fix, handles dir correctly
another bug fix