Added scope filtering
Merged upstrea/add-scope-filtering