move IE localStorage check into its own function