Added console logs for server update state & added back the writing of state.