You don't need the quotes around the ~p; if the supplied term is string, the quotes are added for you.