modified try block