added exception logging