expand ~ in homedir

Expand ~ in the homedir parameter