new state api with breaking change