fix the directory bug