Fixed the filtering step