move script code to default.html