modified try.groovy