fix error reporting

'line' was missing in the scope which caused an assertion failure