various fixes
debug socket close