handle top level scope