fix notification logic