Added server checking via ping and debug logging