use getcwd() instead of exec('pwd')