fixes SQL for scope implementation in walkthrough