adding in close alert functionality