Changed IOError to OSError