added flush(index)