Fix store duplicate issue.
Add error handling.