add local storage detection