fix for provider / now checking for both local storage and cookie