add logic to handle when node is at one side