fixed logsum exp bug