Fix for filtering selected elements

There is a issue where when you filter selected items. If the selected item was filtered and you change the filter where that same item is still filtered it won't enter the first if statement and go into the second if statement. (This shouldn't happen because it's saying that the element hasn't been filtered)