fixed flash messages and other stuff