fix the bug after the dir loction has been changed