fixed localStorage errors