fixed sample.py errors