added loopback support