closure for updating state