Move node variable assignment above call to set_enabled_state