implementing search as service to be called multiple times when line breaks are detected