change current directory automatically