add read & write function