fixed some n+1 queries