Changed check to basestring, allowing for ansi.