Sync the grains on grains.setval, Fix #5009