added a try catch, and turned off notification flag on button click