fixed incompatibility with python 3