Implemented sorting on Index page