use localStorage rather than window.localStorage