fixed compatibility issues with django