add py3 support & fix