firefox with cookies disabled panics and stops execution of the script when checking for a localstorage-variable. added safer checking for localstorage.