Fix to support python 3