Corrected ping timeout code and wrote PING handling/dispatching