fix Issue 9578 - "is a nested function and cannot be accessed from" problem
Merge pull request #2330 from 9rnsr/fix9578

Issue 9578 - "is a nested function and cannot be accessed from" problem