repair pwd to use getcwd