fixed and improved lookupContactByName