Added scope variable for events query