fix python 2 compatibility