improved error check for .lib.find()