fix a bug by creating new nodes instead of changing the given lists