close notices on click and clean up