better handling of recent lines for errors