fixed ping, added calculation of delay of messages