update condition to check by nodeType instead of css class