Fix a bug that sensor event may be reused by system.

- Fix a bug that sensor event may be reused by system. Format the events before caching them.
- also fixed in develop branch