better homedir detection