fixing sample code