copy and paste more stuff to fix python2.6