fix sample code
simplify sample code