fix to work with py2.7