Fixed switch name if it is available

(cherry picked from commit e2f65fe0e60173f04bec8cc1a9fddb65b0609926)