fixed n + 1 query