new append logic