logging
logging
tweaked order to do peer callback before threading