change name of inner to _run_when_active, and fix setattr call

Change-Id: I5703c398ec64dcce995f0bff839666c583ab7844