make scoping dynamic to fix #967
Merge pull request #1045 from concerto/dynamic-scoping-967

make scoping dynamic to fix #967