move query outside loop

Move breadcrumb query outside loop