#1064 Add check for localStorage