Fixing error in sample code