adjust stack counter code to monitor only nested calls