Fix incorrect exception catched