fix the bug of undefined path