Adding try catch on index.