When event storing fails don't dispatch events

Don't dispatch events when storage has failed. This also prevents the callback being called twice.