move 'sys.frames()' call outside of function signature