maybe check for if(localStorage)?