fixed syntax errors for py < 2.5