issue #7: fixed scope implementation