added flash message and updated html