add python3 compatibility