added better reporting of exceptions