Add stacktrace only in debug mode