fixed a bug occurring in Python2.5