fixed compatibility with django 1.5