fixed n+1 queries