deleted unnecessary node removal from function duplicate