Create correct query for visible_to