Added check to ensure that the language tag is a string