add sleep in wait-for-indexes-loop