fix a tricky bug, when accidentally passing a non-string