Improve to support python3