Fix python 2 compatibility issue