catching some exceptions