only loop through tags if they exist