scope issue for setInteractive

fixed a scope issue in the setInteractive function.