Added the function of getting homedir.