line counting for error reporting