fix - do not add a hash to visited if already visited