Add check before trying to close notification