added compability with python 2