Modified the PushStackTrace method to support skipping stack frames