Added flash helper method, and check conditionally for flash messages