check that window.localStorage exists