patched scope error