Add try catch block