removed unused return value
added basic logging of outgoing messages