Make it works on python 2.6 and ealier version, only tested on 2.6