[fixed] read/write bugs