improves notification logic