fix checking duplicated visit