fixing the state machine for notifcations
Merge remote-tracking branch 'origin/master'