substitute HOME with ~