python 3 compatibility

This fixes python 3 compatibility.