Bug fix

The notification should be sent after we change the state