bug fix so that it works on python 2.6.6