fix array access in NotificationFactory