added hasWebStorage parameter to functions