fix test of PING
add connection check