Modified code for Control Node