fix $scopes does not defined

i'm not sure about php. but it working.