Updated addNotification() function