edit readFilter function