main js modified