changed ping_loop prototype