Fixed the stack trace to less defensive