Changed the logic behind the close button on TbAlert
re #348