Fixed bug in sample script