Editing layout and add flash messages