fixing types for exception catching