fixed all sample code