fixed bugs in sample41