fix UsedVars for multiple functions