more logic for the close button alert messages