Error checking and storing to localStorage complete