replaced index with stream