fix the log crash bug