changed layout.js to namespace pattern