fix wrong exception catch