added persistence features to state, rw_lock