make highlighting areas for errors more sensible