move init to javascript doc ready