getting a scope error with token

replace params[scope] which was return nil with
scope that was call a declared variable above