[Issue #9] Fix bug: change filter logic to array_filter