Set outside loop since it is unchanged between iteratations. same with `linkQueryLen`