error highlighting now works more rigourously