fix the functionality for preventing a button from closing the modal.

I tested this with all three cases - undefined, true, false, and it works. 
Thanks for good work!