Implemented ping functionality