fix execution issue when running reduce.py from another directory