adds flash message logic to form partial