remove closing pipe first