fix N+1