fixed localStorage bugs