changed dup of io to rewind