cache data p in state