fix bug in python scripts