remove duplicate function, set autochdir