cleaned up the ping timeout code