between index queries did not work properly