added exception catch