fixed bug where custom close button can be added more than once

fixed bug where custom close button can be added more than once