wrap the code using try/catch as less as possible