Added function 'validateLanguages'