Changed IOError to Exception