Fixing bug with cwd