Made cd change directory in main process and not child process.