add replace temp with chain