fixed no-directory bug