Fix bug in sample