Fix cid generation with mutiple invalid chars
added  a controller to switch the language dynamically