fix bugs in networking
merge