fixed flash messages method