detect the template on the base of debug_backtrace