modify the path and adding completion check in merge.py