Added method to track stack traces.