avoid distinct in model queries as it is not suppored in sqlite