flash message and sorting style corrected