ensuring compatibility with python2.4