If you want to reload layout every page reload you do this:
app.layout = myfunction
NOTE: calling my function without parenthesis, like this