update code the sample works