Return correct results when using a BelongsToMany relationship