bug fixes and implement dummy loopback function