Dirty fix to wait for deleting an index