Added flash notice and sorting for index