updated controller method