integrate layout and some flash messages