Fixed a small bug in the python script