update python3 compatibility