fixing it so it works with python2.6