CloseVisit bug fix