added sorting for uploads