Fixed issue with try\catch block