fixing exception logging