updated controller so it works