manage indexes in a separate thread