apply the chain func