use basestring rather than complex conditional