Turned lambda function QuickSearchForLibrary into a function for better error management