change code to use object controller