Fix undefined  bug.