tern: fix the duplicate language check