implemented db consistency with Stash