fix bug os.chdir in rat.py