fix exception logging