added sort by name and sort by date functionality