Fixing invalid sample code