$fields_filtered isn't defined, shouldn't this be $fields_to_filter?