Fixed query error on loading collections