fix cwd path sanitisation should check if variable is empty