Adding in localstorage check since IE7 does not fail gracefully.