Fix filtering by relation id