changed searchlink to return a string instead of echoing it