Update filters.js to prevent errors

"items" isn't always an array when the method is called which leads to unnecessary error messages.This is a potential fix.