make it python2 and 3 compatible for unicode or str type