add logic for close button alert messages