check if glossary items before running foreach