changes required for compatibility with django 1.5