Modified pet controller to work successfully