Use try catch, add some logging