There are a few ways to seal the end of a piping bag. One is to use a food safe sealant, such as silicone or hot glue. Another is to use a coupler or adapter that has a special closure.