adding exception logging