Fixed the filter so it works in older versions of Django