Fixing issue with highlighting of tables continuing on past where it should