check if scope is defined