allow type to be a single string instead of always an array