fixed notification logic bug