better handling of stack traces