added logging of outgoing data