Fix pipe function