sending pings is done using threads now. Sleeps for one second and then ping again in a loop.