add test to check for IOError