corrections logic with local storage