update languages logic