adding try-catch with exception