added some code for pings