trying to handle some exceptions