python 3 compatible fix