adding try catch with output where it failed