updated controller code
updated controller code