added global try catch block