added flash message handler