handle some exceptions