fixed sample code