ensure local storage is set. remove unused functions