subst-all function working