fixed bugs on loopback