setUserDir only updates the variable if the value is a path in homedir