updated flash messages, added helper method