fix in refine.py to run correctly in linux