augment the API for updateStateByKey