io write function added