updated unit tests for scoping