fixed use of array_filter inside route handling