modify getvisit method