checking for global and local scope