fixed the preduce bug