fix python 3 and python 2.6