fix the bug of undefined