check typeof value when setItem