modified controller and templates