Add a stack trace handler