Fixed an issue when changing the directory