make chdir only in rat.py