added ability to update state