added timing writing index