updated controller with proper addressing