fix issue with filtering by labels and postgres random()