Fix bug in application layout

An unknown variable error occurred with the old version of the template, since the flash message was not accessed properly.