make it works on python 2.6 and earier version, only tested on 2.6