catch IOErrors too