error handling for empty visit list