changed basestring to string_types for python 2.x and 3.x compatibility