Make script compatible for python 2.5