catching IOException int main()