using localStorage only when 'persist' is enabled