[FIX] fix the bug of segment fault.