adds alert for closing