attaching the close in the notification
refactoring and fixing the issue with the notification only dismissing once