scope fix

Resolves #789