fixed $HOME substitution