index.js try catch fix