modified controller to support multi-hop