fix EOL Search error handling infinite loop