use six.string_types instead of basestr for python3 compatibility