Added a method to check scope for identifiers