added test for dynamic scoping