Fix for private browsing JS error

Added a try catch statement for when local storage is not available (i.e. when in private browsing)