Fix bug with search by association