improve code for basic mon_backtrace