add exception logging