Added custom sort method; Fixed permissions bug;