Moved console.log outside filter callback to avoid accessing 'catalog' variable before it was initialized. The log statement was placed inside the filter callback which creates a temporal dead zone for the variable being assigned.