Smarter link

Small changes -- handling error event and case of no resources found.