added ability to update state object