fixed determination and calling of transform function scope