update read/write protocols for state.txt