fixes python3 TypeError; python2 intact