working for python27 and python2.5