modified try/catch flow