replacement and the gluing construction