Modified for Python 3 (single notification)