controller and js modified