fix a check and resolving of homedir