updated controller: js, main and pub