fixing selection when filtering