try to fix the bug that memory corrupted