python2 compatibility fix