Fixed filtering so it now works as expected