fix python 3 incompatibility