support Python2.4 in this code