added debug to get_link and get_switch