fixed bug in python script