store active languages as available languages and remove inactive ones