Moved view rendering to onDomReady