Sync localStorage when exit context