Added flash message middleware.