added check for homedir present