Add function to search for selected text