Updating scoping in errors