improve node state update
use strict comparison
small code style improvement