fixed up ping to check whether it succeeded or not