reordered scope setting for testing

set scope before I redirected the user