Commented out the code that changes the controllers operating mode, since it is not working as expected.