small bug fix to python script