how to make node working both called from parent and directly