updated visit function to resolve a exception