add read/write function.