Adds if/end wrapper in layout file, fixing login/logout