add debugging to addNonlocal and connectHost