Make sure the storage is persisted before triggering the end event/callback