Fix issue with scope not being set