more stringent checking of string inputs
updated for roxygen2 v4