Fix bug: can't use '~' for home folder