bug fix: create one stack frame per function