fix for Python3 compatibility